
let fs = require('fs');
let Mock = require('mockjs');

let arr1 = ['全部', '1906A', '1906B' , '1906C'];
let arr2 = ['全部', '升班' , '末班' , '就业'];

let data = Mock.mock({
    'data|100' : [{
        name : '@cname()',
        "age|18-30" : 0,
        classRoom : () => {
            return arr1[ Math.random()*(arr1.length - 1) + 1 | 0 ];
        },
        sex : () => {
            return Math.random() > 0.5 ? '男' : '女'
        },
        state : () => {
            return arr2[ Math.random()*(arr2.length-1) + 1 | 0 ]
        }
    }]
});

data.classRoom = arr1;
data.state = arr2;


fs.writeFileSync('./data.json' , JSON.stringify(data));

